#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
    int n = 0;
    int ret = 0;
    scanf("%d", &n);
    while (n)
    {
        ret += (n % 10);
        n /= 10;
    }
    printf("%d\n", ret);
    return 0;
}